home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / DB.PAK / DBCTL.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  3KB  |  124 lines

  1. // dbctl.h : Declaration of the CDbCtrl OLE control class.
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1995 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CGenericSet recordset
  15.  
  16. class CGenericSet : public CRecordset
  17. {
  18. public:
  19.     CGenericSet(CDatabase* pDatabase, CString* pstrColumnName);
  20.  
  21. // Field/Param Data
  22.     //{{AFX_FIELD(CGenericSet, CRecordset)
  23.     CString    m_strCurrentValue;
  24.     //}}AFX_FIELD
  25.  
  26.  
  27. // Implementation
  28. protected:
  29.     CString m_strColumnName;
  30.     virtual CString GetDefaultSQL();
  31.     virtual void DoFieldExchange(CFieldExchange* pFX);
  32.     DECLARE_DYNAMIC(CGenericSet)
  33. };
  34.  
  35.  
  36. /////////////////////////////////////////////////////////////////////////////
  37. // CDbCtrl : See dbctl.cpp for implementation.
  38.  
  39. class CDbCtrl : public COleControl
  40. {
  41.     DECLARE_DYNCREATE(CDbCtrl)
  42.  
  43. // Constructor
  44. public:
  45.     CDbCtrl();
  46.  
  47. // Overrides
  48.  
  49.     // Drawing function
  50.     virtual void OnDraw(
  51.                 CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
  52.  
  53.     // Persistence
  54.     virtual void DoPropExchange(CPropExchange* pPX);
  55.  
  56.     // Reset control state
  57.     virtual void OnResetState();
  58.  
  59. // Implementation
  60. protected:
  61.     ~CDbCtrl();
  62.  
  63.     CDatabase     m_cDatabase;
  64.     CGenericSet* m_pRecordSet;
  65.     
  66.     BOOL    m_bConnected;
  67.  
  68.     DECLARE_OLECREATE_EX(CDbCtrl)    // Class factory and guid
  69.     DECLARE_OLETYPELIB(CDbCtrl)        // GetTypeInfo
  70.     DECLARE_OLECTLTYPE(CDbCtrl)
  71.     DECLARE_PROPPAGEIDS(CDbCtrl)        // Property page IDs
  72.  
  73.     // Subclassed control support
  74.     BOOL PreCreateWindow(CREATESTRUCT& cs);
  75.     WNDPROC* GetSuperWndProcAddr(void);
  76.     LRESULT OnOcmCommand(WPARAM wParam, LPARAM lParam);
  77.  
  78. // Message maps
  79.     //{{AFX_MSG(CDbCtrl)
  80.         // NOTE - ClassWizard will add and remove member functions here.
  81.         //    DO NOT EDIT what you see in these blocks of generated code !
  82.     //}}AFX_MSG
  83.     DECLARE_MESSAGE_MAP()
  84.  
  85. // Dispatch maps
  86.     //{{AFX_DISPATCH(CDbCtrl)
  87.     CString m_query;
  88.     afx_msg void OnQueryChanged();
  89.     CString m_dataSource;
  90.     afx_msg void OnDataSourceChanged();
  91.     CString m_tableName;
  92.     afx_msg void OnTableNameChanged();
  93.     CString m_columnName;
  94.     afx_msg void OnColumnNameChanged();
  95.     CString m_userName;
  96.     afx_msg void OnUserNameChanged();
  97.     CString m_password;
  98.     afx_msg void OnPasswordChanged();
  99.     afx_msg void ReQuery();
  100.     //}}AFX_DISPATCH
  101.     DECLARE_DISPATCH_MAP()
  102.  
  103.     afx_msg void AboutBox();
  104.  
  105. // Event maps
  106.     //{{AFX_EVENT(CDbCtrl)
  107.     //}}AFX_EVENT
  108.     DECLARE_EVENT_MAP()
  109.  
  110. // Dispatch and event IDs
  111. public:
  112.     enum {
  113.     //{{AFX_DISP_ID(CDbCtrl)
  114.     dispidDataSource = 2L,
  115.     dispidTableName = 3L,
  116.     dispidColumnName = 4L,
  117.     dispidUserName = 5L,
  118.     dispidPassword = 6L,
  119.     dispidQuery = 1L,
  120.     dispidReQuery = 7L,
  121.     //}}AFX_DISP_ID
  122.     };
  123. };
  124.